<template>
   
    <div>
    {{ ruleForm.images }}
     <UploadFileList v-model="ruleForm.images"></UploadFileList>
    </div>
    
</template>
<script setup lang='ts'>
import { UploadFile, UploadFiles, UploadProps, UploadUserFile } from 'element-plus';
import { ref, reactive } from 'vue';
import UploadFileList from '@/components/upload/UploadFileList.vue'

const BASE_URL = import.meta.env.VITE_BASE_URL;
const IMG_URL = import.meta.env.VITE_IMG_URL;

const headers = reactive({
    Authorization: sessionStorage.getItem('token'),
});

const fileNames = ref<string[]>([]);

const fileList = ref<UploadUserFile[]>([])

const ruleForm = reactive<any>({});

 

const getData = () => {
    //调接口
    const data = {
        "id": 634,
        "name": "34535",
        "mobile": null,
        "pass": null,
        "tel": "34535",
        "logo": "2025/10/27/202510270842318079095.jpg",
        "address": "ss",
        "startTime": "08:50",
        "endTime": "12:40",
        "services": "蔬菜水果",
        "username": "234",
        "intro": "<p>sfsss3453535</p>",
        "images": [
            {
                "id": 40832,
                "storeid": 634,
                "url": "2025/10/27/202510270842571684061.png"
            },
            {
                "id": 40831,
                "storeid": 634,
                "url": "2025/10/27/202510270842035431381.jpg"
            }
        ]
    }




    fileList.value = data.images.map(item => ({ name: item.url, url: IMG_URL + item.url, fileName: item.url }));

    Object.assign(ruleForm, data)

}

getData();
 
</script>
<style scoped lang='less'></style>